<template>
   <div>
    
     <input type="checkbox" v-model="arr" value="30">30 &nbsp;
     <input type="checkbox" v-model="arr" value="15">15 &nbsp;
     <input type="checkbox" v-model="arr" value="65">65 &nbsp;
     <input type="checkbox" v-model="arr" value="12">12 &nbsp;
     <input type="checkbox" v-model="arr" value="29">29 &nbsp;
     <input type="checkbox" v-model="arr" value="8">8 &nbsp;
     <input type="checkbox" v-model="arr" value="6">6 &nbsp;
     <input type="checkbox" v-model="arr" value="5">5 &nbsp;
     <input type="checkbox" v-model="arr" value="66">66 &nbsp;
     <input type="checkbox" v-model="arr" value="22">22 &nbsp;
     <p>累加的值和为:{{sum}}</p>
   </div>
 </template>
 
 <script>
 export default {
   data(){
    
     return{
       arr:[]
     }
   },
   computed:{
     sum(){
       return this.arr.reduce((sum,index) =>{
         return sum += parseFloat(index)
       },0)
     }
   }
 }
 </script>
 
 <style>
 
 </style>